package com.ly.heart.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ly.common.utils.DateUtils;
import com.ly.common.utils.erp.SnowflakeIdWorker;
import com.ly.heart.domain.SurveyReportRoofEntity;
import com.ly.heart.mapper.SurveyReportRoofMapper;
import com.ly.heart.service.ISurveyReportRoofService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 勘测报告的屋顶状况明细Service业务层处理
 * @author wutao
 * @date 2024-05-24
 */
@Service
public class SurveyReportRoofServiceImpl extends ServiceImpl<SurveyReportRoofMapper, SurveyReportRoofEntity> implements ISurveyReportRoofService {

    @Resource
    private SurveyReportRoofMapper erpSurveyReportRoofInfoMapper;

    /**
     * 查询勘测报告的屋顶状况明细
     * @param id 勘测报告的屋顶状况明细ID
     * @return 勘测报告的屋顶状况明细
     */
    @Override
    public SurveyReportRoofEntity selectErpSurveyReportRoofInfoById (String id) {
        return erpSurveyReportRoofInfoMapper.selectErpSurveyReportRoofInfoById ( id );
    }

    /**
     * 查询勘测报告的屋顶状况明细列表
     * @param erpSurveyReportRoofInfo 勘测报告的屋顶状况明细
     * @return 勘测报告的屋顶状况明细
     */
    @Override
    public List<SurveyReportRoofEntity> selectErpSurveyReportRoofInfoList (SurveyReportRoofEntity erpSurveyReportRoofInfo) {
        return erpSurveyReportRoofInfoMapper.selectErpSurveyReportRoofInfoList ( erpSurveyReportRoofInfo );
    }

    /**
     * 新增勘测报告的屋顶状况明细
     * @param erpSurveyReportRoofInfo 勘测报告的屋顶状况明细
     * @return 结果
     */
    @Override
    public int insertErpSurveyReportRoofInfo (SurveyReportRoofEntity erpSurveyReportRoofInfo) {
        erpSurveyReportRoofInfo.setId ( SnowflakeIdWorker.getInstance ().nextStringId () );
        erpSurveyReportRoofInfo.setCreateTime ( DateUtils.getNowDate () );
        return erpSurveyReportRoofInfoMapper.insertErpSurveyReportRoofInfo ( erpSurveyReportRoofInfo );
    }

    /**
     * 修改勘测报告的屋顶状况明细
     * @param erpSurveyReportRoofInfo 勘测报告的屋顶状况明细
     * @return 结果
     */
    @Override
    public int updateErpSurveyReportRoofInfo (SurveyReportRoofEntity erpSurveyReportRoofInfo) {
        erpSurveyReportRoofInfo.setUpdateTime ( DateUtils.getNowDate () );
        return erpSurveyReportRoofInfoMapper.updateErpSurveyReportRoofInfo ( erpSurveyReportRoofInfo );
    }

    /**
     * 批量删除勘测报告的屋顶状况明细
     * @param ids 需要删除的勘测报告的屋顶状况明细ID
     * @return 结果
     */
    @Override
    public int deleteErpSurveyReportRoofInfoByIds (String[] ids) {
        return erpSurveyReportRoofInfoMapper.deleteErpSurveyReportRoofInfoByIds ( ids );
    }

    /**
     * 根据勘测报告Id删除勘测报告屋顶状况列表
     * @param reportId
     * @return 结果
     */
    @Override
    public int deleteSurveyReportRoofByReportId (String reportId) {
        return erpSurveyReportRoofInfoMapper.deleteSurveyReportRoofByReportId ( reportId );
    }

    /**
     * 删除勘测报告的屋顶状况明细信息
     * @param id 勘测报告的屋顶状况明细ID
     * @return 结果
     */
    @Override
    public int deleteErpSurveyReportRoofInfoById (String id) {
        return erpSurveyReportRoofInfoMapper.deleteErpSurveyReportRoofInfoById ( id );
    }
}
